package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url:="http://39.100.78.46/test.php"
	client:=http.Client{
		CheckRedirect: func(req *http.Request, via []*http.Request) error {
			fmt.Println("Redirect:", req)
			return nil

		},
	}
	req,err:=http.NewRequest(http.MethodGet,url,nil)
	if err!=nil{
		panic(err)
	}

	resp,err:=client.Do(req);
	if err!=nil{
		panic(err)
	}
	defer resp.Body.Close()

	if resp.StatusCode!=http.StatusOK{
		err=fmt.Errorf("    wrong status code %d",resp.StatusCode)
		return
	}
	res,err:=ioutil.ReadAll(resp.Body)
	fmt.Printf("%s",res)


}
